<?php
list($id, , $name) = explode('|', '111222333|http://www.qq.com|yeedomliu');
echo "{$id},{$name}"; // 111222333,yeedomliu

foreach ([[1, 'yeedom'], [2, 'yeedomliu']] as list($id, $name)) {
    echo "{$id},{$name}|";
}

$id = '123';
$name = 'yeedomliu';
print_r(compact('id', 'name'));
/**
 * Array
 * (
 * [id] => 123
 * [name] => yeedomliu
 * )
 */

print_r(array_combine(['id', 'name'], ['abc', 'yeedom']));

/**
 * Array
 * (
 * [id] => abc
 * [name] => yeedom
 * )
 */
class Person
{

    public $name;
    public $sex;

    public function __construct($name, $sex) {
        $this->name = $name;
        $this->sex = $sex;
    }
}

$objArray = [
    new Person('yeedom', 'male'),
    new Person('yeedomliu', 'female'),
];
$array = array_combine(array_column($objArray, 'name'), array_column($objArray, 'sex'));
print_r($array);
/**
 * Array
 * (
 * [yeedom] => male
 * [yeedomliu] => female
 * )
 */

print_r(array_flip(['name' => 'yeedomliu', 'sex' => 'male']));
/**
 * Array
 * (
 * [yeedomliu] => name
 * [male] => sex
 * )
 */

//  step 参数
// array(0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100)
foreach (range(0, 100, 10) as $number) {
    echo $number;
}

// 字符序列的使用
// array('a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i');
foreach (range('a', 'i') as $letter) {
    echo $letter;
}
// array('c', 'b', 'a');
foreach (range('c', 'a') as $letter) {
    echo $letter;
}